
export function debounce (fn:Function,delay:number){
    let timer:number|null =null
    return function (...args:Parameters<T>){
         if(timer) clearTimeout(timer)
        timer = setTimeout(()=>{
            fn.apply(this,args) 
        },delay)
    }

}